import React, { Component } from 'react';
import Taro from '@tarojs/taro';
import {connect} from 'react-redux';
import {View, Image, Text} from '@tarojs/components';
import {AtIcon} from 'taro-ui';
import {GetRequest} from "../../utils/tools";
import {http} from "../../utils/http";
import {user} from '../../utils/user.service';
import {TARO_ENV, RESOURCE_URL} from "../../constants/api";
import "./index.scss";

export default class Webview extends Component {
    constructor(props) {
		super(props);
		this.state = {
			srcUrl: ""
		};
	}
    async componentDidShow() {
		Taro.showLoading({title: "请稍等", mask: true});
		const reqParams = Taro.getCurrentInstance().router.params;
		const { id } = reqParams;
		const srcUrl = Taro.getStorageSync("wx_guide_url");
		this.setState({ srcUrl }, () => {
			Taro.hideLoading();
		});
	}

    render() {
		return (
			<View className="wifi-connect-page">
				<web-view src={this.state.srcUrl}></web-view>
			</View>
		)
	}
}
